﻿using System;
using System.IO;
using UnityEngine;

namespace Character
{
	// Token: 0x020001B0 RID: 432
	public class WearCustom : ParameterBase
	{
		// Token: 0x06000B3A RID: 2874 RVA: 0x00041FFC File Offset: 0x000401FC
		public WearCustom(SEX sex, WEAR_TYPE type, int id) : base(sex)
		{
			this.type = type;
			this.id = id;
			this.color = new ColorParameter_PBR2();
		}

		// Token: 0x06000B3B RID: 2875 RVA: 0x00042030 File Offset: 0x00040230
		public WearCustom(SEX sex, WEAR_TYPE type, int id, Color color) : base(sex)
		{
			this.type = type;
			this.id = id;
			this.color = new ColorParameter_PBR2();
		}

		// Token: 0x06000B3C RID: 2876 RVA: 0x00042064 File Offset: 0x00040264
		public WearCustom(WearCustom copy) : base(copy.sex)
		{
			this.Copy(copy);
		}

		// Token: 0x06000B3D RID: 2877 RVA: 0x00042088 File Offset: 0x00040288
		public void Init()
		{
			this.id = -1;
			this.color = new ColorParameter_PBR2();
		}

		// Token: 0x06000B3E RID: 2878 RVA: 0x0004209C File Offset: 0x0004029C
		public void Save(BinaryWriter writer)
		{
			writer.Write((int)this.type);
			base.Write(writer, this.id);
			if (this.color != null)
			{
				this.color.Save(writer);
			}
			else
			{
				writer.Write(0);
			}
		}

		// Token: 0x06000B3F RID: 2879 RVA: 0x000420DC File Offset: 0x000402DC
		public void Load(BinaryReader reader, SEX sex, CUSTOM_DATA_VERSION version)
		{
			this.type = (WEAR_TYPE)reader.ReadInt32();
			base.Read(reader, ref this.id);
			this.color.Load(reader, version);
		}

		// Token: 0x06000B40 RID: 2880 RVA: 0x00042108 File Offset: 0x00040308
		public void Copy(WearCustom source)
		{
			this.type = source.type;
			this.id = source.id;
			if (source.color != null)
			{
				if (this.color == null)
				{
					this.color = new ColorParameter_PBR2();
				}
				this.color.Copy(source.color);
			}
			else
			{
				this.color = null;
			}
		}

		// Token: 0x06000B41 RID: 2881 RVA: 0x0004216C File Offset: 0x0004036C
		public void CheckHasData()
		{
			if (!CustomDataManager.HasWearData(this.sex, this.type, this.id))
			{
				this.id = CustomDataManager.GetWearFirstData(this.sex, this.type, this.id);
				this.color = new ColorParameter_PBR2();
			}
		}

		// Token: 0x04000B92 RID: 2962
		public WEAR_TYPE type = WEAR_TYPE.NUM;

		// Token: 0x04000B93 RID: 2963
		public int id = -1;

		// Token: 0x04000B94 RID: 2964
		public ColorParameter_PBR2 color;
	}
}
